<script>
function setFocus(){
	$('identity').focus()
}

window.addEvent('domready', function(){

		new DatePicker('.demo_noyear', { 
			pickerClass: 'datepicker_vista', 
			yearPicker:	true,
			format: 'Y-m-d' ,
			allowEmpty: true,
			startView:'decades',
		});
		
	//setFocus();
        new FormCheck('anggota_edit', {
		display : {
			errorsLocation : 1,
			showErrors : 1,
			addClassErrorToField : 1
		}
	})
});

</script>
<?php $id = $this->uri->segment(3,0)?>
<form name="anggota_edit" id="anggota_edit" method="post" action="<?php echo site_url(array('just4me','anggota_update',$id))?>">
<?php 
$male = "";
$female = "";
$a = "";
$b = "";
$ab = "";
$o = "";
foreach ($query->result() as $row):
?>
  <table width="0%" border="0" cellspacing="2" cellpadding="3">
    <tr>
      <td valign="top"><table width="0%" border="0" cellspacing="2" cellpadding="3">
        <tr>
          <th align="right">Iidentity</th>
          <td>
          <input type="hidden" name="id_anggota" id="id_anggota" value="<?php echo $row->id_anggota?>"> 
            <input value="<?php echo $row->identity?>" name="identity" type="text" id="identity" size="30" maxlength="25" class="validate['required']"></td>
        </tr>
        <tr>
          <th align="right">Name</th>
          <td>
            <input value="<?php echo $row->name?>" name="name" type="text" id="name" size="35" maxlength="100" class="validate['required']"></td>
        </tr>
        <tr>
          <th align="right">Birthday</th>
          <td><input value="<?php echo $row->place_of_birth?>" name="place_of_birth" type="text" id="place_of_birth" class="validate['required']" size="23" maxlength="100">
          <?php echo $row->birthday?>
            <input name="birthday" type="text" id="birthday" size="10" class="date demo_noyear"></td>
        </tr>
        <tr>
          <th align="right" valign="top">Gender</th>
          <td>
          <?php 
          $gender = $row->gender;
          if($gender=="Laki-Laki"){
          	$male = "checked='checked'";
          }
          if($gender=="Perempuan"){
          	$female = "checked='checked'";
          }
          ?>
          <input name="gender" type="radio" id="radio" value="Laki - Laki" checked="checked" <?php echo $male?>>Laki-Laki<br>
          <input type="radio" name="gender" id="gender" value="Perempuan" <?php echo $female?>>Perempuan
          </td>
        </tr>
        <tr>
          <th align="right">Education</th>
          <td><input value="<?php echo $row->education?>" name="education" type="text" id="education" maxlength="100" class="validate['required']"></td>
        </tr>
        <tr>
          <th align="right">Work</th>
          <td><input value="<?php echo $row->work?>" name="work" type="text" id="work" maxlength="100" class="validate['required']"></td>
        </tr>
        <tr>
          <th align="right">Skill</th>
          <td><select name="skill" id="skill">
           	<option value="<?php echo $row->skill?>"><?php echo $row->skill?></option>
            <option value="Perangkat Lunak">Perangkat Lunak</option>
            <option value="Perangkat Keras">Perangkat Keras</option>
            <option value="Jaringan">Jaringan</option>
            <option value="Keamanan Sistem">Keamanan Sistem</option>
            <option value="Database">Database</option>
            <option value="Multimedia">Multimedia</option>
          </select></td>
        </tr>
        <tr>
          <th align="right" valign="top">Achievment</th>
          <td>
            <textarea name="achievment" id="achievment" cols="45" rows="6"><?php echo $row->achievment?></textarea></td>
        </tr>
      </table></td>
      <td valign="top"><table width="0%" border="0" cellspacing="2" cellpadding="3">
        <tr>
          <th align="right">Email</th>
          <td>
            <input value="<?php echo $row->email?>" name="email" type="text" id="email" size="30" maxlength="150" class="validate['required','email']"></td>
        </tr>
        <tr>
          <th align="right">Website</th>
          <td>
            <input value="<?php echo $row->website?>" name="website" type="text" id="website" size="30" maxlength="150"></td>
        </tr>
        <tr>
          <th align="right">Phone</th>
          <td><input value="<?php echo $row->phone?>" name="phone" type="text" id="phone" size="25" maxlength="20" class="validate['required','phone']"></td>
        </tr>
        <tr>
          <th align="right" valign="top">Address</th>
          <td><input value="<?php echo $row->address?>" name="address" type="text" id="address" size="40" maxlength="200" class="validate['required']"></td>
        </tr>
        <tr>
          <th align="right">Region</th>
          <td>
            <select name="region" id="region">
              	<option value="<?php echo $row->region?>"><?php echo $row->region?></option>
                <option value="Nanggro Aceh Darussalam">Nanggro Aceh Darussalam</option>
                <option value="Sumatra Utara">Sumatra Utara</option>
                <option value="Sumatra Barat">Sumatra Barat</option>
                <option value="Riau">Riau</option>
                <option value="Riau Kepulauan">Riau Kepulauan</option>
                <option value="Jambi">Jambi</option>
                <option value="Sumatra Selatan">Sumatra Selatan</option>
                <option value="Bangka Belitung">Bangka Belitung</option>
                <option value="Bengkulu">Bengkulu</option>
                <option value="Lampung">Lampung</option>
                <option value="DKI Jakarta">DKI Jakarta</option>
                <option value="Jawa Barat">Jawa Barat</option>
                <option value="Banten">Banten</option>
                <option value="Jawa Tengah">Jawa Tengah</option>
                <option value="DI Yogyakarta">DI Yogyakarta</option>
                <option value="Jawa Timur">Jawa Timur</option>
                <option value="Bali">Bali</option>
                <option value="NTB">NTB</option>
                <option value="NTT">NTT</option>
                <option value="Kalimantan Barat">Kalimantan Barat</option>
                <option value="Kalimantan Tengah">Kalimantan Tengah</option>
                <option value="Kalimantan Timur">Kalimantan Timur</option>
                <option value="Kalimantan Selatan">Kalimantan Selatan</option>
                <option value="Sulawesi Utara">Sulawesi Utara</option>
                <option value="Gorontalo">Gorontalo</option>
                <option value="Sulawesi Tengah">Sulawesi Tengah</option>
                <option value="Sulawesi Barat">Sulawesi Barat</option>
                <option value="Sulawesi Selatan">Sulawesi Selatan</option>
                <option value="Sulawesi Tenggara">Sulawesi Tenggara</option>
                <option value="Maluku">Maluku</option>
                <option value="Maluku Utara">Maluku Utara</option>
                <option value="Papua Barat">Papua Barat</option>
                <option value="Papua">Papua</option>
            </select></td>
        </tr>
        <tr>
          <th align="right">City</th>
          <td><input value="<?php echo $row->city?>" name="city" type="text" id="city" size="25" maxlength="100" class="validate['required']"></td>
        </tr>
        <tr>
          <th align="right" valign="top">Blood</th>
          <td valign="top">
          <?php 
          	$blood = $row->blood;
          	if($blood=="A"){
          		$a = "checked='checked'";
          	}
          	if($blood=="B"){
          		$b = "checked='checked'";
          	}
          	if($blood=="AB"){
          		$ab = "checked='checked'";
          	}
          	if($blood=="O"){
          		$o = "checked='checked'";
          	}
          ?>
          <input type="radio" name="blood" id="blood" value="A" <?php echo $a?>>
            A
            <br>
            <input type="radio" name="blood" id="blood" value="B" <?php echo $b?>>
            B
            <br>
            <input type="radio" name="blood" id="blood" value="AB" <?php echo $ab?>>
            AB<br>
  			<input name="blood" type="radio" id="blood" value="O" <?php echo $o?>>
            O</td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td valign="top">&nbsp;</td>
      <td align="right" valign="top"><input type="submit" name="button" id="button" value="Save" class="uiButtonRounded">
      <input type="reset" name="button2" id="button2" value="Reset" class="uiButtonRounded"></td>
    </tr>
  </table>
  <?php endforeach;?>
</form>